package com.real8.plusplayground.client.person;

import com.google.api.gwt.services.plus.shared.model.PersonName;
import com.google.gwt.core.client.GWT;
import com.google.gwt.editor.client.SimpleBeanEditorDriver;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;

public class PersonNameViewer extends Composite implements PersonNameView {
	interface Driver extends
			SimpleBeanEditorDriver<PersonName, PersonNameViewer> {
	}

	private static PersonNameViewImplUiBinder uiBinder = GWT
			.create(PersonNameViewImplUiBinder.class);

	interface PersonNameViewImplUiBinder extends
			UiBinder<Widget, PersonNameViewer> {
	}

	private final Driver driver = GWT.create(Driver.class);

	@UiField
	Label formattedEditor;

	@UiField
	Label honorificPrefixEditor;

	@UiField
	Label givenNameEditor;

	@UiField
	Label middleNameEditor;

	@UiField
	Label familyNameEditor;

	@UiField
	Label honorificSuffixEditor;

	public PersonNameViewer() {
		initWidget(uiBinder.createAndBindUi(this));
		driver.initialize(this);
	}

	@Override
	public SimpleBeanEditorDriver<PersonName, ?> getEditorDriver() {
		return driver;
	}
}
